/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.parallelCompiler.tests;

import org.parallelCompiler.annot.*;
import java.io.*;

/**
 *
 * @author Adnan
 */
public class Test_Math {

    static final String CLASS_NAME = "com/parallelcompiler/tests/Test_Math";
    static int x = 0, y = 0;

    public static void main(String[] args) throws IOException {
        int a = 10, b = 20;
        y = add(a, b);
        x = sub(y, 4);

        plusX();
        plusY();

        System.out.println(sub(add(x, y), 7));

        new DependencyFileGenerator(Test_Math.class).generate();
    }

    @DependencyAnnotation(id = 1, parents = {0})
    private static int add(int a, int b) {
        return a + b;
    }

    @DependencyAnnotation(id = 2, parents = {1})
    private static int sub(int a, int b) {
        return a - b;

    }

    @DependencyAnnotation(id = 3, parents = {1})
    private static void plusY() {
        for (int i = 0; i < 100; i++) {
            y += add(i, i);
        }
    }

    @DependencyAnnotation(id = 4, parents = {2})
    private static void plusX() {
        for (int i = 0; i < 100; i++) {
            x += add(i, i);
        }
    }

    @DependencyAnnotation(id = 5, parents = {0})
    private static void dummy(String abc, Test2 xyz) {
    }
    @DependencyAnnotation(id = 6, parents = {0})
    private static void dummy2(String []abc, Test2[] xyz) {
    }
}
